<?php
/**
 * Created by Pako
 * Date: 2019/5/15
 * Time: 21:21
 */

namespace App\Http\Request\Ad;


use App\Http\Request\Store;

class AdStore extends Store
{
    public function rules()
    {
        $mothod = strtoupper($this->method());
        if ($mothod == 'POST') {
            return [
                'title' => 'required',
                'sort' => 'required',
                'position_id' => 'required',
                'status' => 'required',
                'url' => 'required',
                'start_time' => 'required',
                'end_time' => 'required',
            ];
        } else {
            return [
                'ad_id' => 'required',
                'title' => 'filled',
                'sort' => 'filled',
                'status' => 'filled',
                'url' => 'filled',
                'start_time' => 'filled',
                'end_time' => 'filled',
            ];
        }
    }

    public function attributes()
    {
        return [
            'title' => "广告标题",
            'sort' => "排序",
            'status' => "是否禁用",
            'url' => "广告链接地址",
            'start_time' => "广告开始时间",
            'end_time' => "广告结束时间",
        ];
    }
}